//generate heteroskedas plot for KKPS
clear all
set more off

use "$datadir\kkps_dat.dta", clear
set seed 1234

// estimate the model in LogOLS and compute RMSE, MAE, and plot 
qui reg	lognetinc ydum1-ydum11 ydum13-ydum20 loginc [aw = hweight] 	if age<65 & landlord != 1
keep if e(sample)

//visualize the relationship with binscatter

xtile qs=loginc [aw = hweight] , nq(10)

graph box netinc, over(qs,  label(nolab)) noout  scheme(s1mono)  nolab ytitle("Net Income") 
graph export "${res}boxp_KKPS.png", replace
